const SYSTEM_INFO = uni.getSystemInfoSync();
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight || 10;//定义一个刘海屏的高度

// export 向外导出
export const getTitleBarHeight = ()=>{
	if(uni.getMenuButtonBoundingClientRect){
		let {top,height} =  uni.getMenuButtonBoundingClientRect();
		return height + (top - getStatusBarHeight())*2 // 胶囊按钮的高度
	}else{
		return 40;
	}
}

// 标题栏的高度，让下面被遮挡的部分露出来
export const getNavBarHeight = ()=> getStatusBarHeight()+getTitleBarHeight();


// 抖音小程序的标题
export const getLeftIconLeft = ()=>{
	// #ifdef MP-TOUTIAO
		let{leftIcon:{left,width}} = tt.getCustomButtonBoundingClientRect();
		return left+parseInt(width);
	// #endif
	// #ifndef MP-TOUTIAO
		return 0
	// #endif
}